<?php
session_start();
include "config/koneksi.php";
$username = $_POST['user_id'];
$pass = $_POST['password'];
$cekuser = mysql_query("SELECT * FROM com_user WHERE username = '$username'");
$jumlah = mysql_num_rows($cekuser);
$hasil = mysql_fetch_array($cekuser);
if($jumlah == 0) {
echo "Username Belum Terdaftar!<br/>";
echo "<a href='login.php'>Back</a>";
} else {
if($pass <> $hasil['password']) {
echo "Password Salah!<br/>";
echo "<a href='login.php'> Back</a>";
 }else {
$_SESSION['username'] = $hasil['username'];
$_SESSION['ID_user'] = $hasil['no_pendaftaran'];
header('location:nilai.php');
 }
}
?>